package com.sky.controller.user;

import com.sky.dto.UserLoginDTO;
import com.sky.pojo.Category;
import com.sky.result.Result;
import com.sky.service.user.UserLoginService;
import com.sky.vo.UserLoginVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "用户登录")
public class UserLoginController {

    private UserLoginService userLoginService;



    @Autowired
    public void setUserLoginService(UserLoginService userLoginService) {
        this.userLoginService = userLoginService;
    }

    @PostMapping("/user/user/login")
    @ApiOperation("用户登录")
    public Result login(@RequestBody UserLoginDTO dto){

        UserLoginVO loginVO = userLoginService.login(dto);
        return Result.success(loginVO);
    }


}
